Integrand size = 21, antiderivative size = 57 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {(a+b)^2 \log (\cosh (c+d x))}{d}-\frac {b (a+b) \tanh ^2(c+d x)}{2 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^2}{4 d} \]
Time = 0.37 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.88 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {-4 (a+b)^2 \log (\cosh (c+d x))+2 b (2 a+b) \tanh ^2(c+d x)+b^2 \tanh ^4(c+d x)}{4 d} \]
-1/4*(-4*(a + b)^2*Log[Cosh[c + d*x]] + 2*b*(2*a + b)*Tanh[c + d*x]^2 + b^ 2*Tanh[c + d*x]^4)/d
Time = 0.26 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 26, 4153, 26, 353, 49, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -i \tan (i c+i d x) \left (a-b \tan (i c+i d x)^2\right )^2dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i \int \tan (i c+i d x) \left (a-b \tan (i c+i d x)^2\right )^2dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle -\frac {i \int \frac {i \tanh (c+d x) \left (b \tanh ^2(c+d x)+a\right )^2}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \frac {\int \frac {\tanh (c+d x) \left (b \tanh ^2(c+d x)+a\right )^2}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 353 |
\(\displaystyle \frac {\int \frac {\left (b \tanh ^2(c+d x)+a\right )^2}{1-\tanh ^2(c+d x)}d\tanh ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \frac {\int \left (\frac {(a+b)^2}{1-\tanh ^2(c+d x)}-b (a+b)-b \left (b \tanh ^2(c+d x)+a\right )\right )d\tanh ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-b (a+b) \tanh ^2(c+d x)-\frac {1}{2} \left (a+b \tanh ^2(c+d x)\right )^2+(a+b)^2 \left (-\log \left (1-\tanh ^2(c+d x)\right )\right )}{2 d}\) |
(-((a + b)^2*Log[1 - Tanh[c + d*x]^2]) - b*(a + b)*Tanh[c + d*x]^2 - (a + b*Tanh[c + d*x]^2)^2/2)/(2*d)
3.2.47.3.1 Defintions of rubi rules used
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[(x_)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_Symbol] :> Simp[1/2 Subst[Int[(a + b*x)^p*(c + d*x)^q, x], x, x^2], x] /; FreeQ[ {a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.10 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.61
method | result | size |
derivativedivides | \(\frac {-\frac {\tanh \left (d x +c \right )^{4} b^{2}}{4}-\tanh \left (d x +c \right )^{2} a b -\frac {b^{2} \tanh \left (d x +c \right )^{2}}{2}-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (-a^{2}-2 a b -b^{2}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(92\) |
default | \(\frac {-\frac {\tanh \left (d x +c \right )^{4} b^{2}}{4}-\tanh \left (d x +c \right )^{2} a b -\frac {b^{2} \tanh \left (d x +c \right )^{2}}{2}-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (-a^{2}-2 a b -b^{2}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(92\) |
parts | \(\frac {a^{2} \ln \left (\cosh \left (d x +c \right )\right )}{d}+\frac {b^{2} \left (-\frac {\tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {2 a b \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}\) | \(106\) |
parallelrisch | \(-\frac {\tanh \left (d x +c \right )^{4} b^{2}+4 a^{2} d x +8 a b d x +4 b^{2} d x +4 \tanh \left (d x +c \right )^{2} a b +2 b^{2} \tanh \left (d x +c \right )^{2}+4 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{2}+8 \ln \left (1-\tanh \left (d x +c \right )\right ) a b +4 \ln \left (1-\tanh \left (d x +c \right )\right ) b^{2}}{4 d}\) | \(111\) |
risch | \(-a^{2} x -2 a b x -b^{2} x -\frac {2 a^{2} c}{d}-\frac {4 a b c}{d}-\frac {2 c \,b^{2}}{d}+\frac {4 b \,{\mathrm e}^{2 d x +2 c} \left (a \,{\mathrm e}^{4 d x +4 c}+b \,{\mathrm e}^{4 d x +4 c}+2 \,{\mathrm e}^{2 d x +2 c} a +b \,{\mathrm e}^{2 d x +2 c}+a +b \right )}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{4}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) b^{2}}{d}\) | \(178\) |
1/d*(-1/4*tanh(d*x+c)^4*b^2-tanh(d*x+c)^2*a*b-1/2*b^2*tanh(d*x+c)^2-1/2*(a ^2+2*a*b+b^2)*ln(tanh(d*x+c)-1)+1/2*(-a^2-2*a*b-b^2)*ln(tanh(d*x+c)+1))
Leaf count of result is larger than twice the leaf count of optimal. 1638 vs. \(2 (53) = 106\).
Time = 0.28 (sec) , antiderivative size = 1638, normalized size of antiderivative = 28.74 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\text {Too large to display} \]
-((a^2 + 2*a*b + b^2)*d*x*cosh(d*x + c)^8 + 8*(a^2 + 2*a*b + b^2)*d*x*cosh (d*x + c)*sinh(d*x + c)^7 + (a^2 + 2*a*b + b^2)*d*x*sinh(d*x + c)^8 + 4*(( a^2 + 2*a*b + b^2)*d*x - a*b - b^2)*cosh(d*x + c)^6 + 4*(7*(a^2 + 2*a*b + b^2)*d*x*cosh(d*x + c)^2 + (a^2 + 2*a*b + b^2)*d*x - a*b - b^2)*sinh(d*x + c)^6 + 8*(7*(a^2 + 2*a*b + b^2)*d*x*cosh(d*x + c)^3 + 3*((a^2 + 2*a*b + b ^2)*d*x - a*b - b^2)*cosh(d*x + c))*sinh(d*x + c)^5 + 2*(3*(a^2 + 2*a*b + b^2)*d*x - 4*a*b - 2*b^2)*cosh(d*x + c)^4 + 2*(35*(a^2 + 2*a*b + b^2)*d*x* cosh(d*x + c)^4 + 3*(a^2 + 2*a*b + b^2)*d*x + 30*((a^2 + 2*a*b + b^2)*d*x - a*b - b^2)*cosh(d*x + c)^2 - 4*a*b - 2*b^2)*sinh(d*x + c)^4 + 8*(7*(a^2 + 2*a*b + b^2)*d*x*cosh(d*x + c)^5 + 10*((a^2 + 2*a*b + b^2)*d*x - a*b - b ^2)*cosh(d*x + c)^3 + (3*(a^2 + 2*a*b + b^2)*d*x - 4*a*b - 2*b^2)*cosh(d*x + c))*sinh(d*x + c)^3 + (a^2 + 2*a*b + b^2)*d*x + 4*((a^2 + 2*a*b + b^2)* d*x - a*b - b^2)*cosh(d*x + c)^2 + 4*(7*(a^2 + 2*a*b + b^2)*d*x*cosh(d*x + c)^6 + 15*((a^2 + 2*a*b + b^2)*d*x - a*b - b^2)*cosh(d*x + c)^4 + (a^2 + 2*a*b + b^2)*d*x + 3*(3*(a^2 + 2*a*b + b^2)*d*x - 4*a*b - 2*b^2)*cosh(d*x + c)^2 - a*b - b^2)*sinh(d*x + c)^2 - ((a^2 + 2*a*b + b^2)*cosh(d*x + c)^8 + 8*(a^2 + 2*a*b + b^2)*cosh(d*x + c)*sinh(d*x + c)^7 + (a^2 + 2*a*b + b^ 2)*sinh(d*x + c)^8 + 4*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^6 + 4*(7*(a^2 + 2 *a*b + b^2)*cosh(d*x + c)^2 + a^2 + 2*a*b + b^2)*sinh(d*x + c)^6 + 8*(7*(a ^2 + 2*a*b + b^2)*cosh(d*x + c)^3 + 3*(a^2 + 2*a*b + b^2)*cosh(d*x + c)...
Leaf count of result is larger than twice the leaf count of optimal. 122 vs. \(2 (48) = 96\).
Time = 0.13 (sec) , antiderivative size = 122, normalized size of antiderivative = 2.14 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\begin {cases} a^{2} x - \frac {a^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + 2 a b x - \frac {2 a b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a b \tanh ^{2}{\left (c + d x \right )}}{d} + b^{2} x - \frac {b^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b^{2} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{2} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right )^{2} \tanh {\left (c \right )} & \text {otherwise} \end {cases} \]
Piecewise((a**2*x - a**2*log(tanh(c + d*x) + 1)/d + 2*a*b*x - 2*a*b*log(ta nh(c + d*x) + 1)/d - a*b*tanh(c + d*x)**2/d + b**2*x - b**2*log(tanh(c + d *x) + 1)/d - b**2*tanh(c + d*x)**4/(4*d) - b**2*tanh(c + d*x)**2/(2*d), Ne (d, 0)), (x*(a + b*tanh(c)**2)**2*tanh(c), True))
Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (53) = 106\).
Time = 0.28 (sec) , antiderivative size = 186, normalized size of antiderivative = 3.26 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=b^{2} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + 2 \, a b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a^{2} \log \left (\cosh \left (d x + c\right )\right )}{d} \]
b^2*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 4*(e^(-2*d*x - 2*c) + e^(-4*d *x - 4*c) + e^(-6*d*x - 6*c))/(d*(4*e^(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) + 2*a*b*(x + c/d + log(e^(- 2*d*x - 2*c) + 1)/d + 2*e^(-2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d* x - 4*c) + 1))) + a^2*log(cosh(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 116 vs. \(2 (53) = 106\).
Time = 0.33 (sec) , antiderivative size = 116, normalized size of antiderivative = 2.04 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} {\left (d x + c\right )} - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {4 \, {\left ({\left (a b + b^{2}\right )} e^{\left (6 \, d x + 6 \, c\right )} + {\left (2 \, a b + b^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} + {\left (a b + b^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{4}}}{d} \]
-((a^2 + 2*a*b + b^2)*(d*x + c) - (a^2 + 2*a*b + b^2)*log(e^(2*d*x + 2*c) + 1) - 4*((a*b + b^2)*e^(6*d*x + 6*c) + (2*a*b + b^2)*e^(4*d*x + 4*c) + (a *b + b^2)*e^(2*d*x + 2*c))/(e^(2*d*x + 2*c) + 1)^4)/d
Time = 1.83 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.33 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=x\,\left (a^2+2\,a\,b+b^2\right )-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (b^2+2\,a\,b\right )}{2\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a^2+2\,a\,b+b^2\right )}{d}-\frac {b^2\,{\mathrm {tanh}\left (c+d\,x\right )}^4}{4\,d} \]